home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 6.6 KB | 213 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: Linking.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef LINKING_H
- #define LINKING_H
-
- #ifndef CELL_H
- #include "Cell.h"
- #endif
-
- // ----- Framework Layer -----
-
- #ifndef FWLNKDST_H
- #include "FWLnkDst.h"
- #endif
-
- #ifndef FWLNKSRC_H
- #include "FWLnkSrc.h"
- #endif
-
- #ifndef FWLNKMGR_H
- #include "FWLnkMgr.h"
- #endif
-
- #ifndef FWPOINT_H
- #include "FWPoint.h"
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class CTablePart;
- class FW_CPart;
- class FW_CPresentation;
- class CTableSelection;
- class FW_CFrame;
- class ODPart;
- class ODDraft;
- class CTablePartContent;
- class CTableSelectionContent;
-
- //========================================================================================
- // class CTableLinkSource
- //========================================================================================
-
- class CTableLinkSource : public FW_CLinkSource
- {
- public:
- CTableLinkSource(Environment* ev,
- ODUpdateID changeID,
- FW_CPresentation* presentation,
- CTablePart* part,
- CTablePartContent* content,
- CTableSelection* selection);
- virtual ~ CTableLinkSource();
-
- //--- FW_CLinkSource overrides
- virtual void LinkEstablished(Environment* ev);
- virtual void ExternalizeLinkContent(Environment* ev, ODStorageUnit* linkSU);
-
- virtual void BreakLink(Environment* ev);
-
- virtual void DoExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- virtual FW_Boolean HasEmbeddedFrame(Environment* ev, ODFrame* odEmbeddedFrame);
- virtual void RevealLinkSource(Environment* ev, FW_CFrame* frame);
-
- //--- FW_CLink overrides
- virtual ODShape* DoCreateLinkBorderShape(Environment* ev);
- virtual void DoDrawLinkBorder(Environment* ev, ODShape* outline, FW_CGraphicContext& gc);
-
- //--- Specific to Table part
- CCell GetCell(Environment* ev) const;
- void SetCell(Environment* ev, const CCell& cell);
- virtual void RestoreLink(Environment* ev, FW_CPart* part); //Override
-
-
- private:
- CTablePart* fTablePart;
- CTableSelectionContent* fPublishedContent;
- };
-
- //========================================================================================
- // class CTableLink
- //========================================================================================
-
- class CTableLink : public FW_CLinkDestination
- {
- public:
- CTableLink(Environment* ev,
- ODLink* odLink,
- ODLinkInfo* linkInfo,
- FW_CPresentation* presentation,
- CTablePart* part,
- CTablePartContent* content,
- CTableSelection* destSelection);
- virtual ~ CTableLink();
-
- //--- FW_CLinkDestination overrides
- virtual void LinkEstablished(Environment* ev);
- virtual FW_Boolean DoUpdateLink(Environment* ev, ODStorageUnit* linkContentSU, ODPasteAsResult* embedInfo);
-
- virtual void BreakLink(Environment* ev);
-
- virtual void DoExternalizeLink(Environment* ev, ODStorageUnit* storageUnit,
- FW_CCloneInfo* cloneInfo);
-
- virtual FW_CFrame* GetContainingFrame(Environment* ev, ODFrame* odEmbeddedFrame);
-
- //--- FW_CLink overrides
- virtual ODShape* DoCreateLinkBorderShape(Environment* ev);
- virtual void DoDrawLinkBorder(Environment* ev, ODShape* outline, FW_CGraphicContext& gc);
-
- //--- Could move to FW_CLinkDestination
- FW_CPresentation* GetPresentation(Environment* ev);
-
- //--- Specific to Table part
- CCell GetCell(Environment* ev) const;
- void SetCell(Environment* ev, const CCell& cell);
-
- private:
- CTablePart* fTablePart;
- CTableSelectionContent* fLinkedContent;
- };
-
- //========================================================================================
- // CTableLink Inlines
- //========================================================================================
-
- //----------------------------------------------------------------------------------------
- // CTableLink::GetPresentation
- //----------------------------------------------------------------------------------------
- inline FW_CPresentation* CTableLink::GetPresentation(Environment*)
- {
- return fPresentation;
- }
-
- //========================================================================================
- // class CTableLinkManager
- //========================================================================================
-
- class CTableLinkManager : public FW_CLinkManager
- {
- //----------------------------------------------------------------------------------------
- // Constructors/Destructors
- //
- public:
- CTableLinkManager(Environment* ev, CTablePart* thePart, CTablePartContent* tableContent);
- virtual ~CTableLinkManager();
-
- //----------------------------------------------------------------------------------------
- // Override Methods
- //
- public:
-
- FW_DECLARE_AUTO(CTableLinkManager)
-
- virtual FW_CLinkSource* NewLinkSource(Environment* ev,
- ODUpdateID updateID,
- FW_CPresentation* presentation);
- virtual FW_CLinkDestination* NewLinkDestination(Environment* ev,
- ODLink* odLink,
- ODLinkInfo* linkInfo,
- FW_CPresentation* presentation);
-
- virtual FW_CLinkSource* DoInternalizeOneSourceLink(Environment* ev,
- ODStorageUnit* storageUnit,
- ODUpdateID updateID);
- virtual FW_CLinkDestination* DoInternalizeOneDestLink(Environment* ev, ODStorageUnit* storageUnit,
- ODLink* odLink, ODLinkInfo* linkInfo);
-
- virtual void DoChangeLinkStatus(Environment* ev, ODFrame* odFrame);
- // formerly named LinkStatusChanged
-
- virtual ODValueType GetSourceLinkFormat(Environment* ev);
- virtual ODValueType GetDestLinkFormat(Environment* ev);
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- void BreakExistingLinks(Environment* ev, const CCell& cell);
- void MoveExistingLinks(Environment* ev,
- const CCell& fromCell,
- const CCell& toCell);
-
- CTableLinkSource* CellToSourceLink(Environment* ev, const CCell& cell) const;
- CTableLink* CellToLink(Environment* ev, const CCell& cell) const;
-
- CTableLinkSource* GetSelectedLinkSource(Environment* ev);
- void UpdateLinkSource(Environment* ev, ODUpdateID updateID);
-
- private:
- FW_Boolean IsCellInLink(Environment* ev, const CCell& cell);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- CTablePart* fTablePart;
- CTablePartContent* fTableContent;
- };
-
-
- #endif